from pydantic import BaseModel, Field
from typing import Optional, Union

class UserSchemas(BaseModel):
    username: str = Field(description='用户名', min_length=2, max_length=10, pattern=r'^[a-z]{2,10}$')
    password: str
    nickname: Optional[str] = None
    email: Optional[str] = None



class login(BaseModel):
    username: str = Field(description='用户名', min_length=2, max_length=10, pattern=r'^[a-z]{2,10}$')
    password: str